package com.usian.controller;

import com.usian.AdNode;
import com.usian.Result;
import com.usian.feign.ContentFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/frontend/content")
@RestController
public class ContentController {

    @Autowired
    private ContentFeign contentFeign;

    /**
     * 首页查询大广告位
     *
     * @return
     */
    @RequestMapping("selectFrontendContentByAD")
    public Result selectFrontendContentByAD(){

        List<AdNode> adNodeList = contentFeign.selectFrontendContentByAD();
        if(adNodeList.size()>0){
            return Result.ok(adNodeList);
        }
        return Result.error("查无数据");
    }
}
